<HTML>
<CENTER><A HREF = "Section_howto.html">Previous Section</A> - <A HREF = "http://sparta.sandia.gov">SPARTA WWW Site</A> - <A HREF = "Manual.html">SPARTA Documentation</A> - <A HREF = "Section_commands.html#comm">SPARTA Commands</A> - <A HREF = "Section_perf.html">Next Section</A> 
</CENTER>






<HR>

<H3>7. Example problems 
</H3>
<P>The SPARTA distribution includes an examples sub-directory with
several sample problems.  Each problem is in a sub-directory of its
own.  They are all small problems that run quickly, requiring at most
a couple of minutes to run on a desktop machine.  Many are 2d so that
they run more quickly and can be easily visualized.  Each problem has
an input script (in.*) and produces a log file (log.*) when it runs.
The data files they use for chemical species or reaction parameters
are copied from the data directory so the problems are self-contained.
</P>
<P>Sample log file outputs on different machines and different numbers of
processors are included in the directories to compare your answers to.
E.g. a log file like log.free.date.foo.P means it ran on P processors
of machine "foo", using the dated SPARTA version.
</P>
<P>If the "dump image" lines in each script are uncommented, a series of
image snapshots will be produced.  Animations of several of the
examples can be viewed on the Movies section of the <A HREF = "http://sparta.sandia.gov">SPARTA WWW
Site</A>.
</P>
<P>These are the sample problems in the examples sub-directories.  See
the examples/README file for more details.
</P>
<UL><LI>chem = chemistry in a 3d box
<LI>circle = 2d flow around a circular object
<LI>collide = collisional motion in a 3d box
<LI>free = free molecular motion in a 3d box
<LI>sphere = 3d flow around a sphere
<LI>spiky = 2d flow around a spiky circle
<LI>step = 2d flow around a staircase of steps 
</UL>
<P>Here is how you might run and visualize one of the sample problems:
</P>
<PRE>cd free
cp ../../src/spa_g++ .           # copy SPARTA executable to this dir
spa_g++ < in.free                # run the problem 
</PRE>
<P>Running the simulation produces the file log.sparta and optionall
image.*.jpg.  If you have the freely available ImageMagick toolkit on
your machine, you can run its "convert" command to create an animated
GIF, and visualize it from the FireFox browser as follows:
</P>
<PRE>convert image*ppm movie.gif
firefox ./movie.gif 
</PRE>
<P>A similar command should work with other browsers.  Or you can select
"Open File" under the File menu of your browser and load the animated
GIF file directly.
</P>
</HTML>
